package com.advert.service.util;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.*;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@Name("executorService")
@Scope(ScopeType.APPLICATION)
@AutoCreate
public class ExecutorServiceManager {
    private ExecutorService executorService;

    @Create
    public void init() {
        executorService = Executors.newFixedThreadPool(20);
    }

    @Unwrap
    public ExecutorService  getExecutorService() {
        return executorService;
    }

}
